import { createRouter, createWebHashHistory } from 'vue-router'
import BasicLayout from '@/components/layout/BasicLayout' // 基本路由布局
import RouterView from '@/components/layout/RouterView'

// 权限路由
const asyncRoutes = [
  // 首页是可以直接访问的还是放在权限里面,先放在这里吧
  {
    path: '/console',
    name: 'Console',
    meta: {
      title: '首页',
      hidden: false
    },
    title: '首页',
    redirect: '/home',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/home',
        name: 'Home',
        meta: {
          title: '首页',
          hidden: false
        },
        component: () => import('@/views/Home.vue')
      }
    ]
  },

  // 内容管理
  {
    path: '/content',
    name: 'Content',
    meta: {
      title: '内容管理',
      hidden: false
    },
    redirect: '/content/service',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/content/center',
        name: 'ContentCenter',
        meta: {
          title: '内容中心', // 不知道这名字反正起的奇怪的要命？？？
          hidden: true
        },
        redirect: '/content/center/all',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/center/all',
            name: 'ContentCenterAll',
            meta: {
              title: '全部内容',
              hidden: false
            },
            component: () => import('@/views/content/center/all.vue')
          },
          {
            path: '/content/center/classify',
            name: 'ContentCenterClassify',
            meta: {
              title: '分类管理',
              hidden: false
            },
            component: () => import('@/views/content/center/classify.vue')
          }
        ]
      },
      {
        path: '/content/service',
        name: 'ContentService',
        meta: {
          title: '服务管理',
          hidden: false
        },
        redirect: '/content/service/index',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/service/index',
            name: 'ContentServiceIndex',
            meta: {
              title: '服务项目',
              hidden: false
            },
            component: () => import('@/views/content/service/index.vue')
          },
          {
            path: '/content/service/check',
            name: 'ContentServiceCheck',
            meta: {
              title: '上架审核',
              hidden: false
            },
            component: () => import('@/views/content/service/indexCheck.vue')
          },
          {
            path: '/content/service/kinds',
            name: 'ContentServiceKinds',
            meta: {
              title: '服务分类',
              hidden: false
            },
            component: () => import('@/views/content/service/kinds.vue')
          },
          {
            path: '/content/service/twoKinds',
            name: 'ContentServiceTwoKinds',
            meta: {
              // title: "二级分类",
              title: '服务分类',
              type: 'action',
              hidden: true
            },
            component: () => import('@/views/content/service/twoKinds.vue')
          },
          {
            path: '/content/service/threeKinds',
            name: 'ContentServicethreeKinds',
            meta: {
              // title: "二级分类",
              title: '服务分类',
              type: 'action',
              hidden: true
            },
            component: () => import('@/views/content/service/threeKinds.vue')
          },
          {
            path: '/content/report',
            name: 'ContentReport',
            meta: {
              title: '专项护理报告',
              hidden: false
            },
            component: () => import('@/components/layout/RouterView.vue'),
            redirect: '/content/report/report',
            children: [
              {
                path: '/content/report/report',
                name: 'ContentReportReport',
                meta: {
                  title: '专项护理报告列表',
                  hidden: false
                },
                component: () => import('@/views/content/report/report.vue')
              },
              {
                path: '/content/report/options',
                name: 'ContentReportOptions',
                meta: {
                  title: '字段配置',
                  hidden: true
                },
                component: () => import('@/views/content/report/options.vue')
              }
            ]
          }
        ]
      },
      {
        path: '/content/translate',
        name: 'ContentTranslate',
        meta: {
          title: '渠道扫码下单管理',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/content/translate/list',
        children: [
          {
            path: '/content/translate/list',
            name: 'ContentTranslateList',
            meta: {
              title: '渠道扫码配置',
              hidden: false,
              keepAlive: true
            },
            component: () => import('@/views/content/translate/list/index.vue')
          },
          {
            path: '/content/translate/order',
            name: 'ContentTranslateOrder',
            meta: {
              title: '渠道扫码订单',
              hidden: false
              // keepAlive: true //是否缓存当前组件
            },
            component: () => import('@/views/content/translate/order/index.vue')
          },
          {
            path: '/content/translate/options',
            name: 'ContentTranslateOptions',
            meta: {
              title: '字段配置',
              hidden: true
            },
            component: () => import('@/views/content/translate/options/index.vue')
          }
        ]
      },
      {
        path: '/content/ali',
        name: 'ContentAliOrder',
        meta: {
          title: '阿里门店管理',
          hidden: false
        },
        redirect: '/content/ali/store',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/ali/storelist',
            name: 'ContentALiStoreList',
            meta: {
              title: '门店列表',
              hidden: false
            },
            component: () => import('@/views/content/ali/storelist.vue')
          },
          {
            path: '/content/ali/productlist',
            name: 'ContentALiProductList',
            meta: {
              title: '商品列表',
              hidden: false
            },
            component: () => import('@/views/content/ali/productlist.vue')
          }
        ]
      },
      {
        path: '/content/images',
        name: 'ContentImages',
        meta: {
          title: '图库管理',
          hidden: true
        },
        redirect: '/content/images/all',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/images/all',
            name: 'ContentImagesAll',
            meta: {
              title: '全部图库',
              hidden: false
            },
            component: () => import('@/views/content/images/all.vue')
          },
          {
            path: '/content/images/classify',
            name: 'ContentImagesClassify',
            meta: {
              title: '分类管理'
            },
            component: () => import('@/views/content/images/classify.vue')
          }
        ]
      },
      {
        path: '/content/material',
        name: 'ContentMaterial',
        meta: {
          title: '耗材管理',
          hidden: false
        },
        redirect: '/content/material/list',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/material/list',
            name: 'ContentMaterialList',
            meta: {
              title: '耗材列表',
              hidden: false
            },
            component: () => import('@/views/content/material/list.vue')
          },
          {
            path: '/content/material/check',
            name: 'ContentMaterialCheck',
            meta: {
              title: '耗材审核',
              hidden: false
            },
            component: () => import('@/views/content/material/listCheck.vue')
          },
          {
            path: '/content/material/price',
            name: 'ContentMaterialPrice',
            meta: {
              title: '价格管理',
              hidden: true
            },
            component: () => import('@/views/content/material/price.vue')
          },
          {
            path: '/content/material/recycle',
            name: 'ContentMaterialRecycle',
            meta: {
              title: '耗材回收站',
              hidden: true
            },
            component: () => import('@/views/content/material/recycle.vue')
          }
        ]
      },
      // 轮播图管理
      {
        path: '/content/swiper',
        name: 'ContentSwiper',
        meta: {
          title: '轮播图管理',
          hidden: false
        },
        redirect: '/content/swiper/list',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/swiper/list',
            name: 'ContentSwiperList',
            meta: {
              title: '轮播图',
              hidden: false
            },
            component: () => import('@/views/content/swiper/list.vue')
          }
        ]
      },
      // 知识库管理
      {
        path: '/content/know',
        name: 'ContentKnow',
        meta: {
          title: '知识库管理',
          hidden: false
        },
        redirect: '/content/know/list',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/know/list',
            name: 'ContentKnowList',
            meta: {
              title: '知识库',
              hidden: false
            },
            component: () => import('@/views/content/know/list.vue')
          }
        ]
      },
      {
        path: '/content/news',
        name: 'ContentNews',
        meta: {
          title: '护士小鹿官网',
          hidden: false
        },
        redirect: '/content/news/list',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/news/list',
            name: 'ContentNewsList',
            meta: {
              title: '新闻资讯',
              hidden: false
            },
            component: () => import('@/views/content/news/list.vue')
          }
        ]
      },
      {
        path: '/content/nurse-vip',
        name: 'ContentNursVip',
        meta: {
          title: '护士会员',
          hidden: false
        },
        redirect: '/content/nurse-vip/list',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/nurse-vip/list',
            name: 'ContentVipList',
            meta: {
              title: '护士会员',
              hidden: false
            },
            component: () => import('@/views/content/nurse-vip/list/index.vue')
          }
        ]
      },
      {
        path: '/content/video',
        name: 'ContentVideo',
        meta: {
          title: '视频管理',
          hidden: false
        },
        redirect: '/content/video/list',
        component: () => import('@/components/layout/RouterView.vue'),
        children: [
          {
            path: '/content/video/list',
            name: 'ContentVideoList',
            meta: {
              title: '视频管理',
              hidden: false
            },
            component: () => import('@/views/content/video/list/index.vue')
          }
        ]
      }
    ]
  },
  // 促销管理
  // {
  // path: '/promotion',
  // name: 'Promotion',
  // hidden: true,
  // meta: {
  //     title: '促销管理'
  // },
  // redirect: '/promotion/classify',
  // component: () => import("@/components/layout/BasicLayout.vue"),
  // children: [
  //     {
  //       path: '/promotion/classify',
  //       name: 'PromotionClassify',
  //       hidden: false,
  //       meta: {
  //         title: '促销分类'
  //       },
  //       redirect:'/promotion/classify/coupons',
  //       component: () => import("@/components/layout/RouterView.vue"),
  //       children:[
  //         {
  //           path: '/promotion/classify/coupons',
  //           name: 'PromotionClassifyCoupons',
  //           hidden: false,
  //           meta: {
  //             title: '优惠券列表'
  //           },
  //           component: () => import("@/views/promotion/classify/coupons.vue"),
  //         },
  //         {
  //           path: '/promotion/classify/activity',
  //           name: 'PromotionClassifyActivity',
  //           hidden: false,
  //           meta: {
  //             title: '活动列表'
  //           },
  //           component: () => import("@/views/promotion/classify/activity.vue"),
  //         }
  //       ]
  //     },
  //     {
  //       path: '/promotion/setting',
  //       name: 'PromotionSetting',
  //       hidden: false,
  //       meta: {
  //         title: '促销设置'
  //       },
  //       redirect:'/promotion/setting/rule',
  //       component: () => import("@/components/layout/RouterView.vue"),
  //       children:[
  //         {
  //           path: '/promotion/setting/rule',
  //           name: 'PromotionSettingRule',
  //           hidden: false,
  //           meta: {
  //             title: '促销规则设置'
  //           },
  //           component: () => import("@/views/promotion/setting/rule.vue"),
  //         }
  //       ]
  //     },
  // ]
  // },
  // 订单管理
  {
    path: '/order',
    name: 'order',
    meta: {
      title: '订单管理',
      hidden: false,
      roles: ['editor']
    },
    redirect: '/order/center',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/order/center',
        name: 'OrderCenter',
        meta: {
          title: '订单中心',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/order/center/all',
        children: [
          {
            path: '/order/center/all',
            name: 'OrderIndex',
            meta: {
              title: '服务订单',
              hidden: false,
              keepAlive: true //是否缓存当前组件
            },
            component: () => import('@/views/order/center/all.vue')
          },

          {
            path: '/order/center/consume',
            name: 'OrderConsume',
            meta: {
              title: '耗材订单',
              hidden: false
            },
            component: () => import('@/views/order/center/consume.vue')
          },
          // {
          //     path: "/order/center/offline",
          //     name: "OrderOffline",
          //     meta: {
          //         title: "线下订单",
          //         hidden: false,
          //     },
          //     component: () => import("@/views/order/center/offline.vue"),
          // },
          {
            path: '/order/center/offline-check',
            name: 'OrderOfflineCheck',
            meta: {
              title: '线下核对',
              hidden: false
            },
            component: () => import('@/views/order/center/offline-check.vue')
          },
          {
            path: '/order/center/order-detail',
            name: 'OrderDetail',
            meta: {
              title: '服务订单',
              hidden: true,
              type: 'action'
            },
            component: () => import('@/views/order/center/order-detail.vue')
          }
        ]
      },
      {
        path: '/order/refund',
        name: 'OrderRefund',
        meta: {
          title: '退款单',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/order/refund/list',
        children: [
          {
            path: '/order/refund/list',
            name: 'OrderRefundList',
            meta: {
              title: '退款服务',
              hidden: false
            },
            component: () => import('@/views/order/refund/list.vue')
          },
          {
            path: '/order/refund/ali',
            name: 'OrderRefundAli',
            meta: {
              title: '阿里退款单',
              hidden: false
            },
            component: () => import('@/views/order/refund/ali.vue')
          },
          {
            path: '/order/refund/fresenius',
            name: 'OrderRefundFresenius',
            meta: {
              title: '费森尤斯退款单',
              hidden: false
            },
            component: () => import('@/views/order/refund/fresenius.vue')
          },
          {
            path: '/order/refund/consume',
            name: 'OrderRefundConsume',
            meta: {
              title: '退款耗材',
              hidden: false
            },
            component: () => import('@/views/order/refund/consume.vue')
          },
          {
            path: '/order/refund/rule',
            name: 'OrderRefundRule',
            meta: {
              title: '退款单规则',
              hidden: false
            },
            component: () => import('@/views/order/refund/rule.vue')
          }
        ]
      },
      {
        path: '/order/promotion',
        name: 'OrderPromotion',
        meta: {
          title: '活动订单',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/order/promotion/group',
        children: [
          {
            path: '/order/promotion/group',
            name: 'OrderPromotionGroup',
            meta: {
              title: '拼团活动',
              hidden: false
            },
            component: () => import('@/views/order/promotion/group.vue')
          },
          {
            path: '/order/promotion/love',
            name: 'OrderPromotionLove',
            meta: {
              title: '爱心卡',
              hidden: false
            },
            component: () => import('@/views/order/promotion/love.vue')
          }
        ]
      }
    ]
  },
  // 业务管理
  {
    path: '/business',
    name: 'Business',
    meta: {
      title: '业务管理',
      hidden: false
    },
    redirect: '/business/audit',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/business/audit',
        name: 'BusinessAudit1',
        meta: {
          title: '护理报告审核',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/business/audit/index',
        children: [
          {
            path: '/business/audit/index',
            name: 'BusinessAuditIndex2',
            meta: {
              title: '审核列表',
              hidden: false
            },
            component: () => import('@/views/business/audit/list.vue')
          }
        ]
      },
      {
        path: '/business/social_worker',
        name: 'BusinessAudit',
        meta: {
          title: '家庭医生签约资料',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/business/audit/index',
        children: [
          {
            path: '/business/social_worker/index',
            name: 'BusinessSocialWorkerIndex',
            meta: {
              title: '家庭医生签约资料',
              hidden: false
            },
            component: () => import('@/views/business/social_worker/index.vue')
          }
        ]
      },
      {
        path: '/business/huli_info',
        name: 'BusinessHuliInfo',
        meta: {
          title: '护理卡资料审核',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/business/huli_info/index',
        children: [
          {
            path: '/business/huli_info/index',
            name: 'BusinessHuliInfoIndex',
            meta: {
              title: '护理卡资料审核',
              hidden: false
            },
            component: () => import('@/views/business/huli_info/list.vue')
          }
        ]
      },
      {
        path: '/business/certification',
        name: 'BusinessCertification',
        meta: {
          title: '认证管理',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/business/certification/nurse',
        children: [
          {
            path: '/business/certification/nurse',
            name: 'BusinessCertificationNurse',
            meta: {
              title: '护士认证',
              hidden: false
            },
            component: () => import('@/views/business/certification/nurse.vue')
          },
          {
            path: '/business/certification/care',
            name: 'BusinessCertificationCare',
            meta: {
              title: '护工认证',
              hidden: false
            },
            component: () => import('@/views/business/certification/care.vue')
          },
          {
            path: '/business/certification/physician',
            name: 'BusinessCertificationPhysician',
            meta: {
              title: '陪诊师认证',
              hidden: false
            },
            component: () => import('@/views/business/certification/physician.vue')
          },
          {
            path: '/business/certification/recovered',
            name: 'BusinessCertificationRecovered',
            meta: {
              title: '康复师认证',
              hidden: false
            },
            component: () => import('@/views/business/certification/recovered/index.vue')
          },
          {
            path: '/business/certification/accompany',
            name: 'BusinessCertificationAccompany',
            meta: {
              title: '陪护认证',
              hidden: true
            },
            component: () => import('@/views/business/certification/accompany.vue')
          },
          {
            path: '/business/certification/nurse-detail',
            name: 'BusinessCertificationNurseDetail',
            meta: {
              title: '护士认证详情',
              hidden: true
            },
            component: () => import('@/views/business/certification/nurse-detail.vue')
          }
        ]
      },
      {
        path: '/business/bill',
        name: 'billlist',
        meta: {
          title: '账单管理'
          // hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/business/bill/list',
        children: [
          {
            path: '/business/bill/list',
            name: 'businessBillList',
            meta: {
              title: '账单管理'
              // hidden: false
            },
            component: () => import('@/views/business/bill/list/index.vue')
          },
          {
            path: '/business/bill/invoicing',
            name: 'businessBillInvoicing',
            meta: {
              title: '开票申请'
              // hidden: false
            },
            component: () => import('@/views/business/bill/invoicing/index.vue')
          },
          {
            path: '/business/bill/invoiceDetail',
            name: 'businessBillInvoicingDetail',
            meta: {
              title: '开票详情',
              hidden: true,
              type: 'action'
            },
            component: () => import('@/views/business/bill/invoiceDetail/index.vue')
          }
        ]
      },
      {
        path: '/business/widthdraw/list',
        name: 'widthdrawlist',
        meta: {
          title: '提现管理',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/business/widthdraw/list',
        children: [
          {
            path: '/business/widthdraw/list',
            name: 'widthdrawWidthdrawList',
            meta: {
              title: '提现详情列表',
              hidden: false
            },
            component: () => import('@/views/business/widthdraw/list.vue')
          },
          {
            path: '/business/widthdraw/worker',
            name: 'widthdrawWorker',
            meta: {
              title: '家庭医生签约提现', //
              hidden: false
            },
            component: () => import('@/views/business/widthdraw/worker.vue')
          },
          {
            path: '/business/widthdraw/setting',
            name: 'widthdrawWidthdrawSetting',
            meta: {
              title: '提现设置',
              hidden: false
            },
            component: () => import('@/views/business/widthdraw/setting.vue')
          }
        ]
      },
      {
        path: '/business/huifang',
        name: 'BusinessHuifang',
        meta: {
          title: '服务回访',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/business/huifang/index',
        children: [
          {
            path: '/business/huifang/index',
            name: 'BusinessHuifangNurse',
            meta: {
              title: '回访记录',
              hidden: false
            },
            component: () => import('@/views/business/huifang/index.vue')
          },
          {
            path: '/business/huifang/detail',
            name: 'BusinessHuifangDetail',
            meta: {
              title: '回访记录',
              // title: "回访详情",
              hidden: true,
              type: 'action'
            },
            component: () => import('@/views/business/huifang/detail.vue')
          },
          {
            path: '/business/huifang/user_evaluate',
            name: 'BusinessHuifangUserEvaluate',
            meta: {
              title: '用户服务评价',
              hidden: false,
              type: 'action'
            },
            component: () => import('@/views/business/huifang/user_evaluate/index.vue')
          }
        ]
      },
      {
        path: '/business/channel',
        name: 'ChannelReservation',
        meta: {
          title: '渠道预约单审核',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/business/channel/reservation',
        children: [
          {
            path: '/business/channel/reservation',
            name: 'BusinessChannelReservation',
            meta: {
              title: '渠道预约单审核',
              hidden: false
            },
            component: () => import('@/views/business/channel/reservation/index.vue')
          }
        ]
      },
      {
        path: '/business/online_service',
        name: 'OnlineService',
        meta: {
          title: '在线客服',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/business/online_service/list',
        children: [
          {
            path: '/business/online_service/list',
            name: 'OnlineServiceList',
            meta: {
              title: '在线客服',
              hidden: false
            },
            component: () => import('@/views/business/online_service/list.vue')
          },
          {
            path: '/business/online_service/auto_reply',
            name: 'OnlineServiceAutoReply',
            meta: {
              title: '自动回复',
              hidden: false
            },
            component: () => import('@/views/business/online_service/auto_reply.vue')
          }
        ]
      }
    ]
  },
  // 用户管理
  {
    path: '/user',
    name: 'User',
    meta: {
      title: '用户管理',
      hidden: false
    },
    redirect: '/user/nurse',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/user/nurse',
        name: 'UserNurse',
        meta: {
          title: '护士端',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/user/nurse/index',
        children: [
          {
            path: '/user/nurse/index',
            name: 'UserNurseIndex',
            meta: {
              title: '全部护士',
              hidden: false
              // isKeepAlive:false,
            },
            component: () => import('@/views/user/nurse/index.vue')
          },
          {
            path: '/user/nurse/nurse-detail',
            name: 'UserNurseDetail',
            meta: {
              // title: "客户信息",
              title: '全部护士',
              hidden: true,
              type: 'action'
            },
            component: () => import('@/views/user/nurse/nurse-detail.vue')
          }
          // 护士页查看的订单详情,
          // {
          //   path: "/user/nurse/order",
          //   name: "UserNurseOrder",
          //   meta: {
          //     title: "查看订单",
          //     hidden: true,
          //   },
          //   component: () => import("@/views/user/nurse/order.vue"),
          // }
        ]
      },
      {
        path: '/user/client',
        name: 'UserClient',
        meta: {
          title: '用户端',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/user/client/index',
        children: [
          {
            path: '/user/client/index',
            name: 'UserClientIndex',
            meta: {
              title: '全部用户',
              hidden: false
            },
            component: () => import('@/views/user/client/index.vue')
          },
          {
            path: '/user/client/client-detail',
            name: 'UserClientDetail',
            meta: {
              title: '全部用户',
              hidden: true
            },
            component: () => import('@/views/user/client/client-detail.vue')
          }
        ]
      }
    ]
  },
  //数据分析
  {
    path: '/analysis',
    name: 'Analysis',
    meta: {
      title: '数据分析',
      hidden: false
    },
    redirect: '/analysis/detail',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/analysis/detail',
        name: 'analysisDetail',
        meta: {
          title: '基础数据',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/analysis/detail/user',
        children: [
          {
            path: '/analysis/detail/user',
            name: 'analysisDetailUser',
            meta: {
              title: '用户数据',
              hidden: false
            },
            component: () => import('@/views/analysis/detail/user.vue')
          },
          {
            path: '/analysis/detail/nurse',
            name: 'analysisDetailNurse',
            meta: {
              title: '护士数据',
              hidden: false
            },
            component: () => import('@/views/analysis/detail/nurse.vue')
          }
        ]
      },
      {
        path: '/analysis/share',
        name: 'analysisShare',
        meta: {
          title: '服务分享',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/analysis/share/user',
        children: [
          {
            path: '/analysis/share/user',
            name: 'analysisShareUser',
            meta: {
              title: '转化数据',
              hidden: false
            },
            component: () => import('@/views/analysis/detail/pv.vue')
          }
        ]
      },
      {
        path: '/analysis/rights',
        name: 'analysisRights',
        meta: {
          title: '权益卡数据',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/analysis/rights/user',
        children: [
          {
            path: '/analysis/rights/user',
            name: 'analysisRightsUser',
            meta: {
              title: '激活/使用',
              hidden: false
            },
            component: () => import('@/views/analysis/rights/data.vue')
          }
        ]
      }
    ]
  },
  {
    path: '/orgin',
    name: 'Orgin',
    meta: {
      title: '机构管理',
      hidden: false
    },
    redirect: '/orgin/all',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/orgin/all',
        name: 'OrginAll',
        meta: {
          title: '机构入驻',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/orgin/all/index',
        children: [
          {
            path: '/orgin/all/index',
            name: 'OrginAllIndex',
            meta: {
              title: '全部机构',
              hidden: false
            },
            component: () => import('@/views/orgin/all/index.vue')
          },
          {
            path: '/orgin/all/detail',
            name: 'OrginAllDetail',
            meta: {
              title: '全部机构',
              // title: "查看详情",
              type: 'action',
              hidden: true
            },
            component: () => import('@/views/orgin/all/detail.vue')
          },
          {
            path: '/orgin/all/shenhe',
            name: 'OrginAllShenhe',
            meta: {
              title: '机构审核',
              hidden: false
            },
            component: () => import('@/views/orgin/all/shenhe.vue')
          },
          {
            path: '/orgin/all/shenheDetail',
            name: 'ShenheDetail',
            meta: {
              // title: "审核详情",
              title: '机构审核',
              type: 'action',
              hidden: true
            },
            component: () => import('@/views/orgin/all/sheheDetail.vue')
          }
        ]
      }
      // {
      //   path: "/orgin/client",
      //   name: "UserClient",
      //   meta: {
      //     title: "用户端",
      //     hidden: false,
      //   },
      //   component: () => import("@/components/layout/RouterView.vue"),
      //   redirect: "/orgin/client/index",
      //   children: [
      //
      //     {
      //       path: "/user/client/client-detail",
      //       name: "UserClientDetail",
      //       meta: {
      //         title: "全部用户",
      //         hidden: true,
      //       },
      //       component: () => import("@/views/user/client/client-detail.vue"),
      //     },
      //   ],
      // },
    ]
  },
  // 营销中心
  {
    path: '/market',
    name: 'Market',
    meta: {
      title: '营销管理',
      hidden: false
    },
    redirect: '/market/detail',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/market/detail',
        name: 'marketDetail',
        meta: {
          title: '营销中心',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/market/detail/list',
        children: [
          {
            path: '/market/detail/list',
            name: 'marketDetailList',
            meta: {
              title: '优惠券',
              hidden: false
            },
            component: () => import('@/views/market/detail/list.vue')
          },
          {
            path: '/market/detail/check',
            name: 'marketDetailCheck',
            meta: {
              title: '优惠券审核',
              hidden: false
            },
            component: () => import('@/views/market/detail/listCheck.vue')
          },
          {
            path: '/market/detail/detail',
            name: 'marketDetailDetail',
            meta: {
              title: '优惠券',
              hidden: true
            },
            component: () => import('@/views/market/detail/detail.vue')
          }
        ]
      },
      // 邀请好友
      {
        path: '/market/partner',
        name: 'marketPartner',
        meta: {
          title: '邀请好友',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/market/partner/list',
        children: [
          {
            path: '/market/partner/list',
            name: 'marketPartnerList',
            meta: {
              title: '邀请明细',
              hidden: false
            },
            component: () => import('@/views/market/partner/list.vue')
          },
          {
            path: '/market/partner/detail',
            name: 'marketPartnerDetail',
            meta: {
              // title: "查看详情",
              title: '邀请明细',
              type: 'action',
              hidden: true
            },
            component: () => import('@/views/market/partner/detail.vue')
          },
          {
            path: '/market/partner/rules',
            name: 'marketPartnerRules',
            meta: {
              title: '规则设定',
              hidden: false
            },
            component: () => import('@/views/market/partner/rules.vue')
          }
        ]
      },
      // 权益卡
      {
        path: '/market/rights',
        name: 'marketRights',
        meta: {
          title: '权益卡',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/market/rights/list',
        children: [
          {
            path: '/market/rights/list',
            name: 'marketRightsList',
            meta: {
              title: '兑换码',
              hidden: false
            },
            component: () => import('@/views/market/rights/list.vue')
          },
          {
            path: '/market/rights/detail',
            name: 'marketRightsDetail',
            meta: {
              title: '查看详情',
              hidden: true
            },
            component: () => import('@/views/market/rights/detail.vue')
          },
          {
            path: '/market/rights/shenhe',
            name: 'marketRightsShenhe',
            meta: {
              title: '兑换码审核',
              hidden: false
            },
            component: () => import('@/views/market/rights/shenhe.vue')
          }
        ]
      },
      //会员卡
      {
        path: '/market/member',
        name: 'marketMember',
        meta: {
          title: '会员卡',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/market/member/list',
        children: [
          {
            path: '/market/member/list',
            name: 'marketMemberList',
            meta: {
              title: '会员卡',
              hidden: false
            },
            component: () => import('@/views/market/member/list/member-list.vue')
          },
          {
            path: '/market/member/review',
            name: 'marketMemberReview',
            meta: {
              title: '会员卡审核',
              hidden: false
            },
            component: () => import('@/views/market/member/review/member-review.vue')
          }
        ]
      },
      //护理卡
      {
        path: '/market/nursing',
        name: 'marketNursing',
        meta: {
          title: '护理卡',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/market/nursing/list',
        children: [
          {
            path: '/market/nursing/list',
            name: 'marketNursingList',
            meta: {
              title: '护理卡',
              hidden: false
            },
            component: () => import('@/views/market/nursing/list.vue')
          },
          {
            path: '/market/nursing/audit',
            name: 'marketNursingAudit',
            meta: {
              title: '护理卡审核',
              hidden: false
            },
            component: () => import('@/views/market/nursing/audit.vue')
          }
        ]
      }
    ]
  },
  // 系统设置
  {
    path: '/setting',
    name: 'Setting',
    meta: {
      title: '系统设置',
      hidden: false
    },
    redirect: '/setting/basic',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/setting/role',
        name: 'SettingRole',
        meta: {
          title: '角色管理',
          hidden: true
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/setting/role/admin',
        children: [
          {
            path: '/setting/role/admin',
            name: 'SettingRoleAdmin',
            // 应该是按钮级别的权限：超级管理员才可以新增、编辑、删除、其它人员只能查看吧。
            meta: {
              title: '管理员维护',
              hidden: false
            },
            component: () => import('@/views/setting/role/admin.vue')
          },
          {
            path: '/setting/role/setting',
            name: 'SettingRoleSetting',
            meta: {
              title: '角色设置',
              hidden: false
            },
            component: () => import('@/views/setting/role/setting.vue')
          },
          {
            path: '/setting/role/log',
            name: 'SettingRoleLog',
            meta: {
              title: '操作日志',
              hidden: false
            },
            component: () => import('@/views/setting/role/log.vue')
          }
        ]
      },

      {
        path: '/setting/basic',
        name: 'SettingBasic',
        meta: {
          title: '基础设置',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/setting/basic/notice',
        children: [
          {
            path: '/setting/basic/notice',
            name: 'SettingBasicNotice',
            meta: {
              title: '系统通知',
              hidden: false
            },
            component: () => import('@/views/setting/basic/notice.vue')
          },
          {
            path: '/setting/basic/msg',
            name: 'SettingBasicMsg',
            meta: {
              title: '短信管理',
              hidden: false
            },
            component: () => import('@/views/setting/basic/msg.vue')
          },
          {
            path: '/setting/basic/push',
            name: 'SettingPushIndex',
            meta: {
              title: 'push通知',
              hidden: false
            },
            component: () => import('@/views/setting/basic/push.vue')
          }
        ]
      },
      {
        path: '/setting/update',
        name: 'SettingUpdate',
        meta: {
          title: '版本更新',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/setting/update/index',
        children: [
          {
            path: '/setting/update/index',
            name: 'SettingUpdateIndex',
            meta: {
              title: '更新记录',
              hidden: false
            },
            component: () => import('@/views/setting/update/index.vue')
          },
          {
            path: '/setting/update/add',
            name: 'SettingUpdateAdd',
            meta: {
              title: '新增更新',
              hidden: true
            },
            component: () => import('@/views/setting/update/add.vue')
          }
        ]
      },
      // 权限管理
      {
        path: '/setting/role',
        name: 'SettingRole',
        meta: {
          title: '权限管理',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/setting/role/member',
        children: [
          {
            path: '/setting/role/member',
            name: 'SettingMemberIndex',
            meta: {
              title: '管理员维护',
              hidden: false
            },
            component: () => import('@/views/setting/role/member.vue')
          },
          {
            path: '/setting/role/record',
            name: 'SettingRecordIndex',
            meta: {
              title: '操作日志',
              hidden: false
            },
            component: () => import('@/views/setting/role/record.vue')
          },
          {
            path: '/setting/communication/index',
            name: 'SettingCommunicationndex',
            meta: {
              title: '企业内部通讯录',
              hidden: false
            },
            component: () => import('@/views/setting/communication/index.vue')
          },
          {
            path: '/setting/role/index',
            name: 'SettingRoleIndex',
            meta: {
              title: '角色管理',
              hidden: false
            },
            component: () => import('@/views/setting/role/index.vue')
          },
          {
            path: '/setting/role/index_edit',
            name: 'SettingRoleIndexEdit',
            meta: {
              // title: "编辑角色",
              title: '角色管理',
              type: 'action',
              hidden: true
            },
            component: () => import('@/views/setting/role/indexEdit.vue')
          }
        ]
      }
    ]
  },
  // 企业邮箱
  /* {
	    path: "/email",
	    name: "Email",
	    meta: {
	      title: "企业邮箱",
	      hidden: false,
	    },
	    redirect: "/email/all",
	    component: () => import("@/components/layout/BasicLayout.vue"),
	    children: [
	      {
	        path: "/email/all",
	        name: "EmailAll",
	        meta: {
	          title: "企业邮箱",
	          hidden: false,
	        },
	        component: () => import("@/components/layout/RouterView.vue"),
	        redirect: "/email/all/look",
	        children: [
	          {
	            path: "/email/all/look",
	            name: "EmailAllLookList",
	            meta: {
	              title: "收件箱",
	              hidden: false,
	            },
	            component: () => import("@/views/email/all/look/email-list.vue"),
	          },
	          {
	            path: "/email/all/look",
	            name: "EmailAllLookDetail",
	            meta: {
	              title: "邮件详情",
	              hidden: true,
	            },
	            component: () => import("@/views/email/all/look/email-detail.vue"),
	          },
	          {
	            path: "/email/all/write",
	            name: "EmailWrite",
	            meta: {
	              title: "写邮件",
	              hidden: false,
	            },
	            component: () => import("@/views/email/all/write/email-write.vue"),
	          },
	          {
	            path: "/email/all/succ",
	            name: "EmailSuccList",
	            meta: {
	              title: "已发送",
	              hidden: false,
	            },
	            component: () => import("@/views/email/all/succ/succ-list.vue"),
	          },
	        ],
	      },
	    ],
	  }, */
  // 意见反馈
  {
    path: '/feedback',
    name: 'Feedback',
    meta: {
      title: '意见反馈',
      hidden: false
    },
    redirect: '/feedback/detail',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/feedback/detail',
        name: 'FeedbackDetail',
        meta: {
          title: '意见反馈详情',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/feedback/detail/list',
        children: [
          {
            path: '/feedback/detail/list',
            name: 'FeedbackDetailList',
            meta: {
              title: '意见反馈列表',
              hidden: false
            },
            component: () => import('@/views/feedback/detail/list.vue')
          },
          {
            path: '/feedback/activity/list',
            name: 'FeedbackActivityList',
            meta: {
              title: '活动意见反馈列表',
              hidden: false
            },
            component: () => import('@/views/feedback/activity/list.vue')
          }
        ]
      }
    ]
  }
  // 安全中心
  // {
  //   path: "/security",
  //   name: "Security",
  //   meta: {
  //     title: "安全中心",
  //     hidden: true,
  //   },
  //   redirect: "/security/center",
  //   component: () => import("@/components/layout/BasicLayout.vue"),
  //   children: [
  //     {
  //       path: "/security/center",
  //       name: "SecurityCenter",
  //       meta: {
  //         title: "安全中心",
  //         hidden: false,
  //       },
  //       component: () => import("@/components/layout/RouterView.vue"),
  //       redirect: "/security/center/list",
  //       children: [
  //         {
  //           path: "/security/center/list",
  //           name: "SecurityCenterList",
  //           meta: {
  //             title: "安全中心列表页",
  //             hidden: false,
  //           },
  //           component: () => import("@/views/security/center/list.vue"),
  //         },
  //       ],
  //     },
  //   ],
  // },
]

// 默认路由
const defaultRoutes = [
  {
    path: '/',
    redirect: 'console',
    meta: {
      title: '护士小鹿', //路由配置信息
      hidden: true
    }
  },
  {
    path: '/console',
    name: 'Console',
    meta: {
      title: '首页',
      hidden: false
    },
    title: '首页',
    redirect: '/home',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/home',
        name: 'Home',
        meta: {
          title: '首页',
          hidden: false
        },
        component: () => import('@/views/Home.vue')
      }
    ]
  },
  // 企业邮箱
  {
    path: '/email',
    name: 'Email',
    meta: {
      title: '企业邮箱',
      hidden: false
    },
    redirect: '/email/all',
    component: () => import('@/components/layout/BasicLayout.vue'),
    children: [
      {
        path: '/email/all',
        name: 'EmailAll',
        meta: {
          title: '企业邮箱',
          hidden: false
        },
        component: () => import('@/components/layout/RouterView.vue'),
        redirect: '/email/all/look',
        children: [
          {
            path: '/email/all/look',
            name: 'EmailAllLookList',
            meta: {
              title: '收件箱',
              hidden: false
            },
            component: () => import('@/views/email/all/look/email-list.vue')
          },
          {
            path: '/email/all/look/email-detail',
            name: 'EmailAllLookDetail',
            meta: {
              title: '查看邮件',
              hidden: true
            },
            component: () => import('@/views/email/all/look/email-detail.vue')
          },
          {
            path: '/email/all/write',
            name: 'EmailWrite',
            meta: {
              title: '写邮件',
              hidden: false
            },
            component: () => import('@/views/email/all/write/email-write.vue')
          },
          {
            path: '/email/all/succ',
            name: 'EmailSuccList',
            meta: {
              title: '已发送',
              hidden: false
            },
            component: () => import('@/views/email/all/succ/succ-list.vue')
          },
          {
            path: '/email/all/succ/email-send',
            name: 'EmailSendList',
            meta: {
              title: '抄送信息',
              hidden: false
            },
            component: () => import('@/views/email/all/succ/email-send.vue')
          }
        ]
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    meta: {
      title: '登录',
      hidden: true
    },
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/forget',
    name: 'ForgetPassword',
    meta: {
      title: '忘记密码',
      hidden: true
    },
    component: () => import('@/views/forget-password.vue')
  },
  {
    path: '/404',
    name: '404',
    meta: {
      title: 'Error Pages',
      hidden: true
    },
    component: () => import('@/views/error/404.vue')
  },
  {
    path: '/403',
    name: '403',
    meta: {
      title: 'Error Pages',
      hidden: true
    },
    component: () => import('@/views/error/403.vue')
  }

  // 匹配所有的路由-404页面这是,它会自己跳转的这
  // {path:'*',redirect:'/404',hidden:true}
]
// const routes = asyncRoutes.concat(...defaultRoutes);
const routes = defaultRoutes

// console.log(routes, '路由是');

const router = createRouter({
  history: createWebHashHistory(),
  // routes,
  routes: routes
})

// 这个是哪个写动态权限的时候写的路由吧！动态生成的是：再次创建路由要那时候是这样子的吧
// 导出权限路由
export { asyncRoutes, defaultRoutes }

export default router
